package com.sise.stuteaintersys.mapper;

import com.sise.stuteaintersys.bean.entity.HomeworkResult;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.Date;
import java.util.List;

/**
 * @ClassName HomeworkResultMapper
 * @Description
 * @Date 2019/1/17 22:00
 * @Version 1.0
 **/
public interface HomeworkResultMapper {
    int insertSelective(HomeworkResult homeworkResult);

    @Select("select * from homework_result where course_id=#{courseId} and student_id=#{studentId} and date = #{date}")
    HomeworkResult select(@Param("courseId") Integer courseId, @Param("studentId") Integer studentId, @Param("date") Date date);

    @Select("select * from homework_result where course_id=#{courseId} order by student_id ASC,date ASC")
    List<HomeworkResult> selectHomework(@Param("courseId") Integer Integer);
}
